Skip to content

fix: use go run for golangci-lint in pre-commit hook#2651

Merged
steveyegge merged 1 commit intosteveyegge:mainfrom
timvisher-dd:timvisher/fix/schema-version-and-hook
Mar 17, 2026
Merged

fix: use go run for golangci-lint in pre-commit hook#2651
steveyegge merged 1 commit intosteveyegge:mainfrom
timvisher-dd:timvisher/fix/schema-version-and-hook

Conversation

@timvisher-dd
Copy link
Contributor

@timvisher-dd timvisher-dd commented Mar 16, 2026

Replace the global golangci-lint binary with go run pinned to v2.10.1 in the pre-commit hook. This ensures golangci-lint is always compiled with the project's Go toolchain, eliminating version-mismatch panics when the global binary was built with an older Go (e.g., 1.25) than the runtime (e.g., 1.26).

Also simplifies the hook by removing the golangci-lint existence check and fallback logic — go run handles fetching/caching automatically.

Test plan

  • Commit a .go file change and confirm the pre-commit hook runs go run golangci-lint successfully without requiring a global install
  • CI passes

@codecov-commenter
Copy link

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
4805 1 4804 548
View the top 1 failed test(s) by shortest run time
github.com/steveyegge/beads/cmd/bd::TestGetVersionsSinceOrder
Stack Traces | 0s run time
=== RUN   TestGetVersionsSinceOrder
    version_tracking_test.go:80: Versions not in chronological order: 0.61.0 (2026-03-15) should come before 0.57.0 (2026-03-01)
--- FAIL: TestGetVersionsSinceOrder (0.00s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@timvisher-dd timvisher-dd force-pushed the timvisher/fix/schema-version-and-hook branch from 2d7a099 to 2fc7074 Compare March 16, 2026 21:31
@timvisher-dd timvisher-dd marked this pull request as ready for review March 16, 2026 21:34
@steveyegge
Copy link
Owner

Thanks for this comprehensive fix PR @timvisher-dd! Most of the changes here have now been fix-merged to main individually:

The remaining unique change is the pre-commit hook switch from global golangci-lint to go run. If you'd like that merged, could you rebase onto current main so the PR only contains that change? That way it can be reviewed on its own merits.

Replace the global golangci-lint binary with `go run` pinned to v2.10.1.
This ensures golangci-lint is always compiled with the project's Go
toolchain, eliminating version-mismatch panics when the global binary
was built with an older Go (e.g., 1.25) than the runtime (e.g., 1.26).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@timvisher-dd timvisher-dd changed the title fix: bump schema version so no_history migration runs on existing DBs fix: use go run for golangci-lint in pre-commit hook Mar 17, 2026
@timvisher-dd timvisher-dd force-pushed the timvisher/fix/schema-version-and-hook branch from 90dbd59 to 6d1777a Compare March 17, 2026 15:31
@timvisher-dd
Copy link
Contributor Author

@steveyegge Looks like the CI failures are pre-exsiting. Feel free to merge.

@steveyegge steveyegge merged commit 679d7bf into steveyegge:main Mar 17, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants